let num = "1234"

//方式1:通过parseInt方法
console.log(typeof (parseInt(num)), parseInt(num)) //number 1234

//方式2:通过number方法
console.log(typeof (Number(num)), Number(num)) //number 1234

//方式3:通过+的方式
console.log(typeof (+num), +num) //number 1234